﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/TreeDataViewList.Master" AutoEventWireup="true" Inherits="iSun.Web.UI.Controls.DojoListPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script>
            var const_entityID = "<% =EntityId %>",//实体ID名称
            const_entityName = "<% =EntityName %>",//实体名称
            const_EditEntity = "<% =EditEntity %>",//编辑实体名
            const_functionId   ="<% =FunctionID %>",//自定义条件
            const_Order ="<% =Order %>",           //排序  
            const_UserId = "<% = UserId %>",       //当前用户ID
            //const_DataFields = [< % =DataFields % >],//
            //const_DataColums = [< % =DataColums % >],

            const_EditWindowWidth = "<% =EditWindowWidth %>px",//编辑界面宽
		    const_EditWindowHeight = "<% =EditWindowHeight %>px",//编辑界面高

            const_QueryField="<% =QuciklyQueryFields %>",
            const_CustomCondition = encodeURI("<% =DefineCondition %>"),//查询方案条件
            const_Condition =  encodeURI("<% =Condition %>"),//
            const_PageTitle=encodeURI("<% =PageTitle %>"),
            _buttons = [<%=strButtons %>]; // "[<% %>]";

            var grid, store, dataStore; //用于dojo.common.list.base.js
            //列表结构
			    var _dataJSON = "treelist.xhjson?table=<%=EntityName %>&functionid=<%=Function %>&condition=<%=Condition%>&r="+Math.random;
           

    require(["dojo/ready", "dijit/Toolbar", "dijit/form/Button", "dojo/_base/array"], function (ready, Toolbar, Button, array) {
            ready(function () {
                var toolbar = new Toolbar({}, "toolbar");
                //array.forEach(["SetUser/设置用户", "SetFunc/功能权限", "SetFuncOper/操作权限"], function (label) {
                array.forEach(_buttons,function(label){
                    var button = new Button({
                        // note: should always specify a label, for accessibility reasons.
                        // Just set showLabel=false if you don't want it to be displayed normally
                        label: label.split("/")[1],
                        showLabel: true,
                        onClick: function () {
                            if (typeof (fnCommonBtnFn) == "function") { fnCommonBtnFn(label.split("/")[0]); }
                            //alert(label.split("/")[1]);
                          },
                        iconClass: "dijitEditorIcon dijitEditorIcon" + label.split("/")[0]
                    });
                    //debugger
                    toolbar.addChild(button);
                });
            });
        });

    </script>
    <script src="../_Scripts/dojo.common.treelist.base.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="toolbar" runat="server">
    <div id="toolbar"></div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="contentPlace" runat="server">
    <div id="grid"></div>
</asp:Content>
<%--<asp:Content ID="Content4" ContentPlaceHolderID="LeftData" runat="server">
   
</asp:Content>--%>
